#! /bin/bash

/export/server/presto/bin/presto --server hadoop01:8090 --catalog hive --schema default --execute \
" \
\
create table mysql.zxjy.day_school \
( \
    time        varchar, \
    school_id   varchar, \
    school_name varchar, \
    enrollment  int \
); \
 \
create table mysql.zxjy.month_school \
( \
    time        varchar, \
    school_id   varchar, \
    school_name varchar, \
    enrollment  int \
); \
 \
create table mysql.zxjy.year_school \
( \
    time        varchar, \
    school_id   varchar, \
    school_name varchar, \
    enrollment  int \
); \
 \
\
create table mysql.zxjy.day_origin_school \
( \
    time        varchar, \
    origin_type varchar, \
    school_id   varchar, \
    school_name varchar, \
    enrollment  int \
); \
 \
create table mysql.zxjy.month_origin_school \
( \
    time        varchar, \
    origin_type varchar, \
    school_id   varchar, \
    school_name varchar, \
    enrollment  int \
); \
 \
create table mysql.zxjy.year_origin_school \
( \
    time        varchar, \
    origin_type varchar, \
    school_id   varchar, \
    school_name varchar, \
    enrollment  int \
); \
 \
\
create table mysql.zxjy.day_origin_subject \
( \
    time         varchar, \
    origin_type  varchar, \
    subject_id   varchar, \
    subject_name varchar, \
    enrollment   int \
); \
 \
create table mysql.zxjy.month_origin_subject \
( \
    time         varchar, \
    origin_type  varchar, \
    subject_id   varchar, \
    subject_name varchar, \
    enrollment   int \
); \
 \
create table mysql.zxjy.year_origin_subject \
( \
    time         varchar, \
    origin_type  varchar, \
    subject_id   varchar, \
    subject_name varchar, \
    enrollment   int \
); \
 \
\
create table mysql.zxjy.day_origin_school_subject \
( \
    time         varchar, \
    origin_type  varchar, \
    school_id    varchar, \
    school_name  varchar, \
    subject_id   varchar, \
    subject_name varchar, \
    enrollment   int \
); \
 \
create table mysql.zxjy.month_origin_school_subject \
( \
    time         varchar, \
    origin_type  varchar, \
    school_id    varchar, \
    school_name  varchar, \
    subject_id   varchar, \
    subject_name varchar, \
    enrollment   int \
); \
 \
create table mysql.zxjy.year_origin_school_subject \
( \
    time         varchar, \
    origin_type  varchar, \
    school_id    varchar, \
    school_name  varchar, \
    subject_id   varchar, \
    subject_name varchar, \
    enrollment   int \
); \
 \
\
create table mysql.zxjy.day_origin_type_channel \
( \
    time           varchar, \
    origin_type    varchar, \
    origin_channel varchar, \
    enrollment     int \
); \
 \
create table mysql.zxjy.month_origin_type_channel \
( \
    time           varchar, \
    origin_type    varchar, \
    origin_channel varchar, \
    enrollment     int \
); \
 \
create table mysql.zxjy.year_origin_type_channel \
( \
    time           varchar, \
    origin_type    varchar, \
    origin_channel varchar, \
    enrollment     int \
); \
 \
\
create table mysql.zxjy.day_origin_department \
( \
    time            varchar, \
    origin_type     varchar, \
    department_name varchar, \
    enrollment      int \
); \
 \
create table mysql.zxjy.month_origin_department \
( \
    time            varchar, \
    origin_type     varchar, \
    department_name varchar, \
    enrollment      int \
); \
 \
create table mysql.zxjy.year_origin_department \
( \
    time            varchar, \
    origin_type     varchar, \
    department_name varchar, \
    enrollment      int \
); \
 \
\
create table mysql.zxjy.day_origin_intent \
( \
    time                   varchar, \
    origin_type            varchar, \
    enrollment             int, \
    intention              int, \
    "intent_enroll_rate`/``%`" double \
); \
 \
create table mysql.zxjy.month_origin_intent \
( \
    time                   varchar, \
    origin_type            varchar, \
    enrollment             int, \
    intention              int, \
    "intent_enroll_rate`/``%`" double \
); \
 \
create table mysql.zxjy.year_origin_intent \
( \
    time                   varchar, \
    origin_type            varchar, \
    enrollment             int, \
    intention              int, \
    "intent_enroll_rate`/``%`" double \
); \
 \
\
create table mysql.zxjy.day_origin_valid \
( \
    time                  varchar, \
    origin_type           varchar, \
    enrollment            int, \
    valid                 int, \
    "valid_enroll_rate`/``%`" double \
); \
 \
create table mysql.zxjy.month_origin_valid \
( \
    time                  varchar, \
    origin_type           varchar, \
    enrollment            int, \
    valid                 int, \
    "valid_enroll_rate`/``%`" double \
); \
 \
create table mysql.zxjy.year_origin_valid \
( \
    time                  varchar, \
    origin_type           varchar, \
    enrollment            int, \
    valid                 int, \
    "valid_enroll_rate`/``%`" double \
); \
"